package cn.hdu.liang.concurrency;


import java.util.concurrent.TimeUnit;

class NonTask {
    static void longMethod() throws InterruptedException {
        TimeUnit.SECONDS.sleep(60);
    }
}


class Task implements Runnable {
    @Override
    public void run() {
        try {
            NonTask.longMethod();
        } catch(InterruptedException e) {
            System.out.println(e.toString());
        } finally {

        }
    }
}

public class Exam18 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(new Task());
        t.start();
        TimeUnit.SECONDS.sleep(2);
        t.interrupt();
    }
}
